package com.zkthink.ceres.common.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

@Getter
public enum ProfessionTypeEnum {
    ZF_PROFESSION(0, "公务员"),
    SY_PROFESSION(1, "事业单位"),
    GQ_PROFESSION(2, "国企"),
    WQ_PROFESSION(3, "外企"),
    SQ_PROFESSION(4, "私企"),
    ZY_PROFESSION(5, "自营"),
    GTH_PROFESSION(6, "个体户"),
    ZYZY_PROFESSION(7, "自由职业");

    private int code;

    private String desc;

    ProfessionTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ProfessionTypeEnum getDscByType(Integer type) {
        for (ProfessionTypeEnum p : values()) {
            if (p.getCode() == type.intValue()) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}
